#if _MSC_VER > 1000
#pragma once
#endif

#ifndef __BITS_H__
#define __BITS_H__

void print_bstr(int );

#define count_ones(x)                        \
      ({ int _x_ = ((0xaaaaaaaa&x)>>1)+(0x55555555&x); \
       _x_=((0xcccccccc&_x_)>>2)+(0x33333333&_x_); \
       _x_=((0xf0f0f0f0&_x_)>>4)+(0x0f0f0f0f&_x_); \
       _x_=((0xff00ff00&_x_)>>8)+(0x00ff00ff&_x_); \
       _x_=(_x_>>16)+(0x0000ffff&_x_); _x_;})

#endif // __BITS_H__
